package com.danco.training.zaneuskaya.storage;

import java.io.Serializable;

import com.danco.training.zaneuskaya.api.BookService;
import com.danco.training.zaneuskaya.api.ClaimService;
import com.danco.training.zaneuskaya.api.OrderService;
import com.danco.training.zaneuskaya.dependency.DependencyConfiguration;


public class Bookshop implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2386224790479557201L;

	private BookService bookService =  (BookService) DependencyConfiguration.getInstanceByClassName(BookService.class);
	private OrderService orderService = (OrderService) DependencyConfiguration.getInstanceByClassName(OrderService.class);
	private ClaimService claimService = (ClaimService) DependencyConfiguration.getInstanceByClassName(ClaimService.class);

	private static Bookshop bookshopInstance;

	
	
	public BookService getBookService() {
		return bookService;
	}

	public void setBookService(BookService bookService) {
		this.bookService = bookService;
	}

	public OrderService getOrderService() {
		return orderService;
	}

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

	public ClaimService getClaimService() {
		return claimService;
	}

	public void setClaimService(ClaimService claimService) {
		this.claimService = claimService;
	}

	public static Bookshop getBookshopInstance() {
		
		if (bookshopInstance == null) {
			bookshopInstance = new Bookshop();

		}
		return bookshopInstance;
	}

	public static void setBookshopInstance(Bookshop bookshopInstance) {
		Bookshop.bookshopInstance = bookshopInstance;
	}

}